from django.db import models

# Create your models here.


class Sclass(models.Model):
    name = models.CharField(max_length=30)
    type = models.IntegerField(default=1) #1小班  2中班  3大班
    class Meta:
        db_table='sclass'


class Course(models.Model):
    name = models.CharField(max_length=30)
    cla = models.ForeignKey(Sclass,on_delete=models.CASCADE,related_name='courses')

    class Meta:
        db_table='course'

class Stu(models.Model):
    name = models.CharField(max_length=30)
    username = models.CharField(max_length=100)
    password = models.CharField(max_length=200)
    cla = models.ForeignKey(Sclass,on_delete=models.CASCADE)
    class Meta:
        db_table='stu'
